
package com.swak.frame.ump;

import com.swak.frame.dto.base.BaseOperation;

/**
 * @ClassName: UmpOperation.java
 * @author: colley.ma
 * @date: 2022/02/21
 */
public class UmpOperation implements BaseOperation {
    private static final long serialVersionUID = -8663031715419784133L;

    private String resource;

    private boolean enableHeartbeat;

    private boolean enableTp;

    private String appName;

    public UmpOperation() {}

    public static UmpOperation newOperation(String resource, String appName, UmpTag umpTag) {
        UmpOperation operation = new UmpOperation();
        operation.setResource(resource);
        operation.setEnableHeartbeat(umpTag.enableHeartbeat());
        operation.setEnableTp(umpTag.enableTP());
        operation.setAppName(appName);
        return operation;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getResource() {
        return resource;
    }

    public void setResource(String resource) {
        this.resource = resource;
    }

    public boolean isEnableHeartbeat() {
        return enableHeartbeat;
    }

    public void setEnableHeartbeat(boolean enableHeartbeat) {
        this.enableHeartbeat = enableHeartbeat;
    }

    public boolean isEnableTp() {
        return enableTp;
    }

    public void setEnableTp(boolean enableTp) {
        this.enableTp = enableTp;
    }

}
